package com.guijq.design.practice.one;

import java.util.function.Consumer;

/**
 * @Author timyag
 * @Date 2021/4/15 10:24
 * @Version 1.0
 */
public class LuckyBox extends Box {

    public LuckyBox(int innderMoney) {
        super(innderMoney);
    }

    @Override
    protected <T extends Role> Consumer<Role> getRoleBehavior(Class<T> roleClass) {
        return (role) -> {
            role.money += this.money * 2;
        };

    }

}
